#pragma once

#define SUBSTATE_WAITING_FOR_INPUT 1

namespace locals {
  static byte SubState = SUBSTATE_WAITING_FOR_INPUT;
  static byte Counter = 0;
}



class ProgramHandler {

private:
  static void ProcessSubstateWaitingForInput() 
  {
    SetLed( locals::Counter );
    // Jetzt muss hier die Tastatur betrachtet werden
    delay(100);
    locals::Counter = locals::Counter >= sizeof(LedArray) ? 0 : locals::Counter + 1;
  }
  
public:

  ///
  /// Must be called before entering the Programming Mode.
  ///
  static void Init() 
  { 
    locals::SubState = SUBSTATE_WAITING_FOR_INPUT; 
  }
  
  static void HandleProgrammSetup() 
  {
    switch(locals::SubState) {
      case SUBSTATE_WAITING_FOR_INPUT:
        ProcessSubstateWaitingForInput();
    } 
  }

};



